package com.yznote.cloudesk.file.server;

import com.yznote.cloudesk.common.pojo.DeskFile;
import com.yznote.cloudesk.common.pojo.File;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.List;

@Service
public interface FileServer {
    List<DeskFile> getDesk(Long userId);

    List<File> getSonFile(Long fileId,Long userId);

    File getFileByFaIdAndFileName(Long fileFaId,String fileName);

    String insertFile(DeskFile deskFile,Boolean isText,String afterName);
    String insertFile(DeskFile deskFile, String text,String afterName) throws UnsupportedEncodingException;
    String insertFile(DeskFile deskFile, MultipartFile mtf) throws IOException;

    String removeRepeat(Long oldFileId,DeskFile deskFile, MultipartFile mtf, Boolean isCoverage,String afterName) throws IOException;

    String moveDeskFile(Long fileId, Integer x, Integer y);
    String swapDeskFile(DeskFile deskFile1, DeskFile deskFile2);
    String getFilePath(Long fileId);
    String updateFile(File file);
    String updateFileName(File file);

    String deskFileToFile(Long fileId, Long newFileFaId);

    String toDeskFile(Long fileId, Integer x, Integer y);


    Boolean sortDesk(Long userId);
}
